/**********************************************
* TABLE A6: Staff Compensation - All Staffers
***********************************************/

* Panel A: House
clear
use masterdata_house1.dta
gen femalestaff = 0
replace femalestaff = 1 if gender =="F"
gen memfemale = 0
replace memfemale = 1 if minwomen + majwomen > 0

macro define member_char1 "dem memfemale majority chair subchr seniority maj_leader min_leader power"
macro define member_char2 "majority chair subchr seniority maj_leader min_leader power"
macro define staff_char1  "totworkdays rank nondc notfulltime"
macro define staff_char2  "totworkdays rank nondc notfulltime jdphd grad_degree "

gen int1 = dem*femalestaff
gen int2 = dem*femalestaff*memfemale

eststo clear
eststo: quietly reg  salary femalestaff           $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1      $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1 int2 $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char1 i.congress, a(member_office_id) vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char2 i.congress, a(member_office_id) vce(cluster member_office_id)
esttab, star(* 0.05 ** 0.01 *** 0.001) drop(*congress*) se ar2

* Panel B: Senate
clear
use masterdata_senate1.dta
gen memfemale = 0
replace memfemale = 1 if minwomen ==1
replace memfemale = 1 if majwomen ==1

gen femalestaff = 0
replace femalestaff = 1 if gender =="F"

gen int1 = dem*femalestaff
gen int2 = dem*femalestaff*memfemale

macro define member_char1 "dem memfemale majority chair subchr seniority maj_leader min_leader power up_for_reelection freshman"
macro define member_char2 "majority chair subchr seniority maj_leader min_leader power up_for_reelection freshman"
macro define staff_char1  "totworkdays rank nondc notfulltime"
macro define staff_char2  "totworkdays rank nondc notfulltime jdphd grad_degree"

eststo clear
eststo: quietly reg  salary femalestaff           $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1      $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly reg  salary femalestaff int1 int2 $member_char1 $staff_char1 i.congress, vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char1 i.congress, a(member_office_id) vce(cluster member_office_id)
eststo: quietly areg salary femalestaff int1 int2 $member_char2 $staff_char2 i.congress, a(member_office_id) vce(cluster member_office_id)
esttab, star(* 0.05 ** 0.01 *** 0.001) drop(*congress*) se ar2
